package cn.z2huo.knowledge.collection.list.arraylist;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *
 * @author z2huo
 */
public class ClearTest {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>(List.of("12", "abc", "dddd", "dcc"));
        System.out.println(list);

        list.clear();
        System.out.println(list);

        List<String> list2 = new ArrayList<>();
        list2.add(null);
        list2.add(null);
        list2.add(null);
        list2.add(null);
        System.out.println(list2);
        list2.clear();
        System.out.println(list2);
    }
}
